﻿using System;
using System.Threading;

namespace FaceCapture
{
    class Program
    {
        private static readonly ManualResetEvent _shutdownBlock = new ManualResetEvent(false);
        static void Main(string[] args)
        {
            AlertManage am = new AlertManage();
            am.startListen();
            Console.WriteLine("启动监听服务成功");


            Console.CancelKeyPress += Conssole_CancelKeyPresss;
            AppDomain.CurrentDomain.ProcessExit += (sender, EventArgs) =>
            {
                _shutdownBlock.WaitOne();
            };
        }

        private static void Conssole_CancelKeyPresss(object sender, ConsoleCancelEventArgs e)
        {
            e.Cancel = true;
            _shutdownBlock.Set();

        }
    }
}